package gamegui;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Color;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.SwingConstants;
import javax.swing.JMenu;
import javax.swing.UIManager;

import java.awt.FlowLayout;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.awt.GridLayout;
import javax.swing.border.TitledBorder;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

public class Game extends JFrame {

	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
//					UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
					Game frame = new Game();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Game() {
		setBackground(Color.WHITE);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 866, 715);
		
		JMenuBar menuBar = new JMenuBar();
		setJMenuBar(menuBar);
		
		JMenu mnFile = new JMenu("File");
		menuBar.add(mnFile);
		
		JMenuItem mntmNewGame = new JMenuItem("New game");
		mnFile.add(mntmNewGame);
		
		JMenuItem mntmOpen = new JMenuItem("Open");
		mnFile.add(mntmOpen);
		
		JMenuItem mntmSave = new JMenuItem("Save");
		mnFile.add(mntmSave);
		
		JMenuItem mntmSaveAs = new JMenuItem("Save as");
		mnFile.add(mntmSaveAs);
		
		JMenuItem mntmClose = new JMenuItem("Close");
		mnFile.add(mntmClose);
		
		JMenuItem mntmExit = new JMenuItem("Exit");
		mnFile.add(mntmExit);
		
		JMenu mnSetting = new JMenu("Settings");
		menuBar.add(mnSetting);
		
		JMenuItem mntmLanguage = new JMenuItem("Language");
		mnSetting.add(mntmLanguage);
		
		JMenuItem mntmCustomize = new JMenuItem("Customize");
		mnSetting.add(mntmCustomize);
		
		JMenu mnHelp = new JMenu("Help");
		menuBar.add(mnHelp);
		
		JMenuItem mntmHowToPlay = new JMenuItem("How to play");
		mnHelp.add(mntmHowToPlay);
		
		JMenuItem mntmHomePage = new JMenuItem("Home page");
		mnHelp.add(mntmHomePage);
		
		JMenuItem mntmAbout = new JMenuItem("About");
		mnHelp.add(mntmAbout);
		contentPane = new JPanel();
		contentPane.setBackground(Color.WHITE);
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		GridBagLayout gbl_contentPane = new GridBagLayout();
		gbl_contentPane.columnWidths = new int[]{681, 171, 0};
		gbl_contentPane.rowHeights = new int[]{0, 0};
		gbl_contentPane.columnWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		gbl_contentPane.rowWeights = new double[]{1.0, Double.MIN_VALUE};
		contentPane.setLayout(gbl_contentPane);
		
		JPanel gamePanel = new JPanel();
		gamePanel.setBackground(Color.WHITE);
		GridBagConstraints gbc_gamePanel = new GridBagConstraints();
		gbc_gamePanel.insets = new Insets(0, 0, 0, 5);
		gbc_gamePanel.fill = GridBagConstraints.BOTH;
		gbc_gamePanel.gridx = 0;
		gbc_gamePanel.gridy = 0;
		gamePanel.setLayout(new BorderLayout(0, 0));
		GamePanel gamePanel_1 = new GamePanel(20, 20);
		gamePanel_1.setBackground(Color.WHITE);
		gamePanel.add(gamePanel_1, BorderLayout.CENTER);
		contentPane.add(gamePanel, gbc_gamePanel);
		
		
		JPanel extraPanel = new JPanel();
		extraPanel.setBackground(Color.WHITE);
		GridBagConstraints gbc_extraPanel = new GridBagConstraints();
		gbc_extraPanel.fill = GridBagConstraints.BOTH;
		gbc_extraPanel.gridx = 1;
		gbc_extraPanel.gridy = 0;
		contentPane.add(extraPanel, gbc_extraPanel);
		extraPanel.setLayout(new GridLayout(2, 1, 0, 0));
		extraPanel.add(new ScorePanel());
		extraPanel.add(new ChattingPanel());
	}

}
